#! /bin/bash

# (c) Michael Goetze, 2011, mgoetze@mgoetze.net

error=0 ; trap "error=$((error|1))" ERR

cat > $target/etc/sysconfig/clock <<-EOF
	UTC=$UTC
	ZONE=$TIMEZONE
	EOF
cat > $target/etc/sysconfig/i18n <<-EOF
	LANG="$DEFAULTLOCALE"
	SUPPORTED="$SUPPORTEDLOCALE"
	SYSFONT="$CONSOLEFONT"
	EOF
cat > $target/etc/sysconfig/keyboard <<-EOF
	KEYBOARDTYPE="pc"
	KEYTABLE="$KEYMAP"
	EOF

if [ -f $target/usr/lib/locale/locale-archive.tmpl \
     -a  ! -s $target/usr/lib/locale/locale-archive ]; then
    mv $target/usr/lib/locale/locale-archive.tmpl $target/usr/lib/locale/locale-archive
fi

fcopy -iv /etc/sysconfig/i18n /etc/sysconfig/keyboard

exit $error

